import {getcategoryApi} from "@/apis/category.js";
import {onMounted, ref} from "vue";
import {useRoute} from "vue-router";

export function useCategory(){
    const route = useRoute()
    const getcategory = async ()=>{
        const p = await getcategoryApi(route.params.id)
        data.value = p.data.result
    }
    const data = ref({})

    onMounted(()=>{
        // console.log(route.params.id)
        getcategory()
    })
    return {
        data
    }
}
